package models

import (
	"gorm.io/gorm/schema"
	"time"
)

// VerifyCode 验证码
type VerifyCode struct {
	Id int64 `json:"id"  gorm:"primaryKey"`
	SqlTimeFields

	Target string `json:"target" gorm:"type:varchar(32);index"`
	Code   string `json:"code" gorm:"type:varchar(16);index"`

	ExpiredAt *time.Time `json:"expired_at"`
}

func (vc *VerifyCode) TableName(namer schema.Namer) string {
	return namer.TableName("vt_code")
}
